<template>
  <transition name="fade" v-if="status">
    <div class="title-container">
      {{ titleMsg }}
    </div>
  </transition>
</template>

<script>
export default {
  name: 'mytitle',
  data() {
    return {}
  },
  computed: {
    status() {
      return this.$store.state.titleStatus
    },
    titleMsg() {
      return this.$store.state.titleMsg
    }
  }
}
</script>

<style lang="less" scoped>
@import '../../assets/base.less';
.title-container {
  z-index: 999;
  width: 300px;
  height: 100px;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  position: fixed;
  border-radius: 6px;
  top: 50%;
  left: 50%;
  margin-top: -50px;
  margin-left: -150px;
  text-align: center;
  padding: 25px 5px 0;
  box-sizing: border-box;
  line-height: 25px;
  font-size: 14px;
}
// 组件过渡效果
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.5s linear;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
  opacity: 0;
}
.fade-enter-to,
.fade-leave {
  opacity: 1;
}
</style>